/**
 * 格式说明：属性名称==对应属性编辑器的组件名称
 */
const COMMON_PROPERTIES = {
    //字段
    'name': 'name-editor',
    'label': 'label-editor',
    'labelAlign': 'labelAlign-editor',
    'type': 'type-editor',
    'defaultValue': 'defaultValue-editor',
    'placeholder': 'placeholder-editor',
    'startPlaceholder': 'startPlaceholder-editor',
    'endPlaceholder': 'endPlaceholder-editor',
    'columnWidth': 'columnWidth-editor',
    'autoFullWidth': 'autoFullWidth-editor',
    'size': 'size-editor',
    'showStops': 'showStops-editor',
    'displayStyle': 'displayStyle-editor',
    'buttonStyle': 'buttonStyle-editor',
    'border': 'border-editor',
    'labelWidth': 'labelWidth-editor',
    'labelHidden': 'labelHidden-editor',
    'rows': 'rows-editor',
    'required': 'required-editor',
    'requiredHint': 'requiredHint-editor',
    'validation': 'validation-editor',
    'validationHint': 'validationHint-editor',
    'readonly': 'readonly-editor',
    'disabled': 'disabled-editor',
    'hidden': 'hidden-editor',
    'clearable': 'clearable-editor',
    'editable': 'editable-editor',
    'showPassword': 'showPassword-editor',
    'textContent': 'textContent-editor',
    'textAlign': 'textAlign-editor',
    'fontSize': 'fontSize-editor',
    'preWrap': 'preWrap-editor',
    'htmlContent': 'htmlContent-editor',
    'format': 'format-editor',
    'valueFormat': 'valueFormat-editor',
    'filterable': 'filterable-editor',
    'allowCreate': 'allowCreate-editor',
    'remote': 'remote-editor',
    'automaticDropdown': 'automaticDropdown-editor',
    'checkStrictly': 'checkStrictly-editor',
    'showAllLevels': 'showAllLevels-editor',
    'multiple': 'multiple-editor',
    'multipleLimit': 'multipleLimit-editor',
    'contentPosition': 'contentPosition-editor',
    'optionItems': 'optionItems-editor',
    'uploadURL': 'uploadURL-editor',
    'uploadTip': 'uploadTip-editor',
    'withCredentials': 'withCredentials-editor',
    'multipleSelect': 'multipleSelect-editor',
    'limit': 'limit-editor',
    'fileMaxSize': 'fileMaxSize-editor',
    'fileTypes': 'fileTypes-editor',
    'contentHeight': 'contentHeight-editor',
    'customClass': 'customClass-editor',

    //容器
    'showBlankRow': 'showBlankRow-editor',
    'showRowNumber': 'showRowNumber-editor',
    'cellWidth': 'cellWidth-editor',
    'cellHeight': 'cellHeight-editor',
    'colHeight': 'colHeight-editor',
    'wordBreak': 'wordBreak-editor',
    'gutter': 'gutter-editor',
    'responsive': 'responsive-editor',
    'span': 'span-editor',
    'offset': 'offset-editor',
    'push': 'push-editor',
    'pull': 'pull-editor',

    //公有属性
    'layerInfo': 'layerInfo-editor',
    'areaInfo': 'areaInfo-editor',

}

const ADVANCED_PROPERTIES = {
    'min': 'min-editor',
    'max': 'max-editor',
    'precision': 'precision-editor',
    'step': 'step-editor',
    'controlsPosition': 'controlsPosition-editor',
    'minLength': 'minLength-editor',
    'maxLength': 'maxLength-editor',
    'showWordLimit': 'showWordLimit-editor',
    'prefixIcon': 'prefixIcon-editor',
    'suffixIcon': 'suffixIcon-editor',
    'switchWidth': 'switchWidth-editor',
    'activeText': 'activeText-editor',
    'inactiveText': 'inactiveText-editor',
    'activeColor': 'activeColor-editor',
    'inactiveColor': 'inactiveColor-editor',
    'lowThreshold': 'lowThreshold-editor',
    'highThreshold': 'highThreshold-editor',
    'allowHalf': 'allowHalf-editor',
    'showText': 'showText-editor',
    'showScore': 'showScore-editor',
    'range': 'range-editor',
    'vertical': 'vertical-editor',
    'plain': 'plain-editor',
    'round': 'round-editor',
    'circle': 'circle-editor',
    'icon': 'icon-editor',
    'labelIconClass': 'labelIconClass-editor',
    'labelIconPosition': 'labelIconPosition-editor',
    'labelTooltip': 'labelTooltip-editor',
    'appendButton': 'appendButton-editor',
    'appendButtonDisabled': 'appendButtonDisabled-editor',
    'buttonIcon': 'buttonIcon-editor',
    'enableScroll': 'enableScroll-editor',
    'visibleTitle': 'visibleTitle-editor',
    'screenConfig': 'screenConfig-editor',
    'futureInfoConfig': 'futureInfoConfig-editor',
    'title': 'commonTitle-editor',
    'subtitle': 'commonSubTitle-editor',
    'desc': 'commonDesc-editor',
    'infoVideoUrl': 'videoUrl-editor',
    'infoTitle': 'infoTitle-editor',
    'infoIntro': 'infoIntro-editor',
    'width': 'commonWidth-editor',
    'height': 'commonHeight-editor',
    'radius': 'commonRadius-editor',
    'videoUrl': 'videoUrl-editor',
    'showImageUrl': 'imageUrl-editor',
    'imageUrls': 'imageUrls-editor',
    'imageUrl': 'imageUrl-editor',
    'imageHeight': 'imageHeight-editor',
    'imageWidth': 'imageWidth-editor',
    'imageRadius': 'imageRadius-editor',
    'fontColor': 'fontColor-editor',
    'padding': 'commonPadding-editor',
    'margin': 'commonMargin-editor',
    'backgroundColor': 'backgroundColor-editor',
    'showRowNums': 'showRowNums-editor',
    'openScroll': 'openScroll-editor',
    'scrollStep': 'scrollStep-editor',
    'switchScreen': 'switchScreen-editor',
    'switchTime': 'switchTime-editor',

    'waitBloodConfig': 'waitBloodConfig-editor',
    'noticeConfig': 'noticeConfig-editor',
    'waitSingleConfig': 'waitSingleConfig-editor',
    'waitInfoConfig': 'waitInfoConfig-editor',
    'headerOptions': 'headerOptions-editor',
    'DRCInfoOptions': 'DRCInfoOptions-editor',
    'waitingInfoNxUltrasoundConfig': 'waitingInfoNxUltrasoundConfig-editor',

    'waitingScreenConfig': 'waitingScreenConfig-editor',
    'headerConfig': 'headerConfig-editor',
    'headerConfig2': 'headerConfig2-editor',
    'headerConfigDebris': 'headerConfigDebris-editor',
    'passPatientConfig': 'passPatientConfig-editor',
    'waitingInfoConfig': 'waitingInfoConfig-editor',
    'waitingInfoConfig3': 'waitingInfoConfig3-editor',
    'waitingInfoNxConfig': 'waitingInfoNxConfig-editor',
    'waitingRowInfoConfig': 'waitingRowInfoConfig-editor',
    'tipsConfig': 'tipsConfig-editor',
    'callConfig': 'callConfig-editor',
    'DRCHeaderConfig': 'DRCHeaderConfig-editor',
    'DRCInfoConfig': 'DRCInfoConfig-editor',
    'DRCInfoConfig4': 'DRCInfoConfig4-editor',
    'waitingShareCallConfig': 'waitingShareCallConfig-editor',
    'DRCDoubleInfoConfig': 'DRCDoubleInfoConfig-editor',
    'DRCDoctorConfig': 'DRCDoctorConfig-editor',
    'DRCTrendsConfig': 'DRCTrendsConfig-editor',
    'reportInfoConfig': 'reportInfoConfig-editor',
    'reportHeaderConfig': 'reportHeaderConfig-editor',
    'DRCDoublePatientInfoConfig': 'DRCDoublePatientInfoConfig-editor',
    'waitingDualQueueInfoConfig': 'waitingDualQueueInfoConfig-editor',
    'waitingQueueInfoPublicInfoConfig': 'waitingQueueInfoPublicInfoConfig-editor',
    'infoPublicConfig': 'infoPublicConfig-editor',
    'infoPublicConfig1080': 'infoPublicConfig1080-editor',
    'infoPublicTableConfig': 'infoPublicTableConfig-editor',
    'DRCDoctorCodeConfig': 'DRCDoctorCodeConfig-editor',
    'reportPickInfoConfig': 'reportPickInfoConfig-editor',
    'infoPublicPictureConfig': 'infoPublicPictureConfig-editor',
    'windowConfig': 'windowConfig-editor',
    'windowCurrentConfig': 'windowCurrentConfig-editor',
    'windowCurrentNxConfig': 'windowCurrentNxConfig-editor',
    'sceneWaitingCurrent': 'sceneWaitingCurrent-editor',
    'sceneWaitingCurrent2': 'sceneWaitingCurrent2-editor',
    'sceneWaitingCurrent3': 'sceneWaitingCurrent3-editor',
    'sceneDRCCurrentWaiting': 'sceneDRCCurrentWaiting-editor',
    'windowConfig-roomName-roomNo': 'windowConfig-roomName-roomNo-editor',
    'DRCPatientInfoConfig': 'DRCPatientInfoConfig-editor',
    'windowBusinessConfig': 'windowBusinessConfig-editor',
    'windowCallCurrentPatientConfig': 'windowCallCurrentPatientConfig-editor',
    'windowPatientListInfoConfig': 'windowPatientListInfoConfig-editor',
    'publishBoard': 'publishBoard-editor',
    'sceneWaitingDualShare':'sceneWaitingDualShare-editor',
    'waitingPatientsInfoConfig':'waitingPatientsInfoConfig-editor',
    'DRCDSchedulingInfoConfig':'DRCDSchedulingInfoConfig-editor',
    'sceneWaitingCallRecordsConfig':'sceneWaitingCallRecordsConfig-editor',
    'publishScheduling':'publishScheduling-editor',
    'publishSchedulingAdv3096':'publishSchedulingAdv3096-editor',
    'waitDrugstoreConfig':'waitDrugstoreConfig-editor',
    'waitDrugstoreConfig2':'waitDrugstoreConfig2-editor',
    'infoPublicPicture2Config':'infoPublicPicture2Config-editor',
    'publishDoctorSchedule':'publishDoctorSchedule-editor',
    'sceneWaitingCallRecordsConfigTwoDep':'sceneWaitingCallRecordsConfigTwoDep-editor',
    'sceneWaitingCallRecordsTwoQueueMulTwoColus':'sceneWaitingCallRecordsTwoQueueMulTwoColus-editor',
    'publishScheduling2':'publishScheduling2-editor',
    'publishScheduling3':'publishScheduling3-editor',
    'publishScheduling4':'publishScheduling4-editor',
    'publishBoard2':'publishBoard2-editor',
    'DRCInfoConfig2':'DRCInfoConfig2-editor',
    'DRCInfoConfig3':'DRCInfoConfig3-editor',
    'DRCTrendsConfig1':'DRCTrendsConfig1-editor',
    'DRCTrendsConfig3':'DRCTrendsConfig3-editor',
    'waitPatientConfig':'waitPatientConfig-editor',
    'publishRoomDoctor':'publishRoomDoctor-editor',
    'publicDoctorSchedulingConfig': 'publicDoctorSchedulingConfig-editor',
    'DRCTCMInfoConfig':'DRCTCMInfoConfig-editor',
    'sceneWaitRowConfig':'sceneWaitRowConfig-editor',
    'publishDrugstore':'publishDrugstore-editor',
    'sceneWaitCallPatientConfig':'sceneWaitCallPatientConfig-editor',
    'sceneWaitiRowConfig2':'sceneWaitiRowConfig2-editor',
    'scrollXConfig':'scrollXConfig-editor',
    'sceneWaitRowQueueConfig':'sceneWaitRowQueueConfig-editor',
    'sceneWaitRowConfig5':'sceneWaitRowConfig5-editor',
    'windowPublishConfig':'windowPublishConfig-editor',
    'reportKeyboardConfig':'reportKeyboardConfig-editor',
    'reportKeyboardS22XConfig':'reportKeyboardS22XConfig-editor',
    'DRCDoctorInfoConfig':'DRCDoctorInfoConfig-editor',
    'sceneWaitiRowConfig6':'sceneWaitiRowConfig6-editor',
    'sceneWaitingCallPatientConfig': 'sceneWaitingCallPatientConfig-editor',
    'sceneDRCSingleInfoConfig':'sceneDRCSingleInfoConfig-editor',
    'windowConfig3':'windowConfig3-editor',
    'windowPatientInfoConfig':'windowPatientInfoConfig-editor',
    'jcsConfig':'jcsConfig-editor',
    'nxDRCConfig':'nxDRCConfig-editor',
    'nxCommonWxConfig':'nxCommonWxConfig-editor',
}

const EVENT_PROPERTIES = {
    //字段
    'onCreated': 'onCreated-editor',
    'onMounted': 'onMounted-editor',
    'onClick': 'onClick-editor',
    'onInput': 'onInput-editor',
    'onChange': 'onChange-editor',
    'onFocus': 'onFocus-editor',
    'onBlur': 'onBlur-editor',
    'onRemoteQuery': 'onRemoteQuery-editor',
    'onBeforeUpload': 'onBeforeUpload-editor',
    'onUploadSuccess': 'onUploadSuccess-editor',
    'onUploadError': 'onUploadError-editor',
    'onFileRemove': 'onFileRemove-editor',
    'onValidate': 'onValidate-editor',
    'onAppendButtonClick': 'onAppendButtonClick-editor',

    //容器
    'onSubFormRowAdd': 'onSubFormRowAdd-editor',
    'onSubFormRowInsert': 'onSubFormRowInsert-editor',
    'onSubFormRowDelete': 'onSubFormRowDelete-editor',
    'onSubFormRowChange': 'onSubFormRowChange-editor',

}

/**
 * 注册组件常见属性
 * 如属性编辑器的组件名称propEditorName设置为null，则不显示该属性编辑器！！
 * @param uniquePropName 属性名称（保证名称唯一，不跟其他组件属性冲突）
 * @param propEditorName 对应属性编辑器的组件名称
 */
export function registerCommonProperty(uniquePropName, propEditorName) {
    COMMON_PROPERTIES[uniquePropName] = propEditorName
}

/**
 * 注册组件高级属性
 * 如属性编辑器的组件名称propEditorName设置为null，则不显示该属性编辑器！！
 * @param uniquePropName 属性名称（保证名称唯一，不跟其他组件属性冲突）
 * @param propEditorName 对应属性编辑器的组件名称
 */
export function registerAdvancedProperty(uniquePropName, propEditorName) {
    ADVANCED_PROPERTIES[uniquePropName] = propEditorName
}

/**
 * 注册组件事件属性
 * 如属性编辑器的组件名称propEditorName设置为null，则不显示该属性编辑器！！
 * @param uniquePropName 属性名称（保证名称唯一，不跟其他组件属性冲突）
 * @param propEditorName 对应属性编辑器的组件名称
 */
export function registerEventProperty(uniquePropName, propEditorName) {
    EVENT_PROPERTIES[uniquePropName] = propEditorName
}

/**
 * 判断属性是否已注册
 * @param uniquePropName 属性名称（保证名称唯一，不跟其他组件属性冲突）
 */
export function propertyRegistered(uniquePropName) {
    return !!COMMON_PROPERTIES[uniquePropName] || !!ADVANCED_PROPERTIES[uniquePropName] || !!EVENT_PROPERTIES[uniquePropName]
}

/**
 * 注册常见属性对应的属性编辑器
 * @param app
 * @param uniquePropName
 * @param propEditorName
 * @param editorComponent
 */
export function registerCPEditor(app, uniquePropName, propEditorName, editorComponent) {
    app.component(propEditorName, editorComponent)
    registerCommonProperty(uniquePropName, propEditorName)
}

/**
 * 注册高级属性对应的属性编辑器
 * @param app
 * @param uniquePropName
 * @param propEditorName
 * @param editorComponent
 */
export function registerAPEditor(app, uniquePropName, propEditorName, editorComponent) {
    app.component(propEditorName, editorComponent)
    registerAdvancedProperty(uniquePropName, propEditorName)
}

/**
 * 注册事件属性对应的属性编辑器
 * @param app
 * @param uniquePropName
 * @param propEditorName
 * @param editorComponent
 */
export function registerEPEditor(app, uniquePropName, propEditorName, editorComponent) {
    app.component(propEditorName, editorComponent)
    registerEventProperty(uniquePropName, propEditorName)
}

export default {
    COMMON_PROPERTIES,
    ADVANCED_PROPERTIES,
    EVENT_PROPERTIES
}


